package com.day08;

public class Student extends Person{

    String name;
    int age;
    String major;

    public Student() {

    }


    public Student(String name, int age, String major) {
        this.name = name;
        this.age = age;
        this.major = major;
    }

//    public void eat() {
//        System.out.println("吃东西");
//    }
//
//    public void sleep() {
//        System.out.println("睡觉");
//    }

    public void study() {
        super.eat();
        System.out.println("学习");
        System.out.println("学生学习知识");
    }


    //方法的重写
    public void eat() {
        System.out.println("学生吃东西");
    }

    public void show() {
        System.out.println("name = " + this.name + ", age = " + super.age);
    }


}
